<template>
  <div class="gallary-box" @click='returnParent'>
    <swiper class="gallary-swiper" :options="swiperOptions">
      <swiper-slide v-for="(item,index) in imgs" :key="index">
        <img :src="item" alt="gallary" class="gallary-img" />
      </swiper-slide>
      <div class="swiper-pagination" slot="pagination"></div>
    </swiper>
  </div>
</template>

<script>
export default {
  name: "CommonGallary",
  props: {
    imgs: {
      type: Array,
      default() {
        return [];
      },
    },
  },
  data() {
    return {
      swiperOptions: {
        pagination: ".swiper-pagination",
        loop: true,
        paginationType: "fraction",
        observer: true,
        observeParents: true,
        // Some Swiper option/callback...
      },
    };
  },
  methods: {
    returnParent() {
      this.$emit('returnPa')
    }
  }
};
</script>

<style lang="stylus" scoped>
.gallary-box
  z-index 99
  position fixed
  top 0
  left 0
  right 0
  bottom 0
  display flex
  flex-direction column
  justify-content center
  background-color #000000

  .gallary-swiper
    width 100%
    // height 100%
    overflow inherit

    .swiper-pagination
      color #fff
      bottom -1rem
</style>